package cn.gzjp.modules.gas.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.validator.constraints.Length;

import cn.gzjp.common.persistence.DataEntity;
import cn.gzjp.common.utils.excel.annotation.ExcelField;

import java.util.List;

/**
 * 加油站管理Entity
 * @author zengcp
 * @version 2018-03-05
 */
public class GasStation extends DataEntity<GasStation> {
	
	private static final long serialVersionUID = 1L;
	private String name;		// 名称
	private String address;		// 地址
	private String tel;		// 联系电话
	private Integer gunCount;		// 油枪数量

	private List<GasGun> gunList;
	
	public GasStation() {
		super();
	}

	public GasStation(String id){
		super(id);
	}

	@Length(min=0, max=128, message="名称长度必须介于 0 和 128 之间")
	@ExcelField(title="名称", align=2, sort=1)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=256, message="地址长度必须介于 0 和 256 之间")
	@ExcelField(title="地址", align=2, sort=2)
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	@Length(min=0, max=12, message="联系电话长度必须介于 0 和 12 之间")
	@ExcelField(title="联系电话", align=2, sort=3)
	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	@JsonIgnore
	@ExcelField(title="油枪数量", align=2, sort=4)
	public Integer getGunCount() {
		return gunCount;
	}

	public void setGunCount(Integer gunCount) {
		this.gunCount = gunCount;
	}

	public List<GasGun> getGunList() {
		return gunList;
	}

	public void setGunList(List<GasGun> gunList) {
		this.gunList = gunList;
	}
}